package com.tang.sink;

import com.tang.sink.custom.MySink;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 自定义sink
 *
 * @author tang
 * @since 2023/6/9 18:00
 */
public class SinkCustom {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<String> source = env.socketTextStream("192.168.70.141", 7777);

        source.addSink(new MySink<>());

        env.execute();
    }

}
